﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Personal.aspx.cs" Inherits="Formularios_Personal" %>

<%@ Register assembly="obout_Calendar2_Net" namespace="OboutInc.Calendar2" tagprefix="obout" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 150px;
        }
        .style2
        {
            width: 150px;
            height: 64px;
        }
        .style3
        {
            height: 64px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <table style="width: 98%;">
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" bgcolor="#536D95" rowspan="2" 
                style="font-family: Arial, Helvetica, sans-serif; font-size: xx-large; font-weight: bold; color: #FFFFFF">
                Resgistro de Responsables</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center">
                <asp:Label ID="lblMensaje" runat="server" ForeColor="Red"></asp:Label>
            </td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center">
                <hr />
            </td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                <asp:TextBox ID="txtID" runat="server" ValidationGroup="Gtxt" Visible="False"></asp:TextBox>
            </td>
            <td align="center" 
                style="border-style: solid solid none solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ControlToValidate="txtNombre" ErrorMessage="RequiredFieldValidator" 
                    Font-Size="Smaller" ForeColor="Red" ValidationGroup="Gtxt">Debe introducir un nombre</asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                    ControlToValidate="txtNombre" ErrorMessage="RegularExpressionValidator" 
                    Font-Size="Smaller" ForeColor="Red" ValidationExpression="^[a-zA-ZñÑ\s]*$" 
                    ValidationGroup="Gtxt">Debe introducir solo letras</asp:RegularExpressionValidator>
            </td>
            <td align="center" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000">
                <asp:TextBox ID="txtNombre" runat="server" Height="22px" ValidationGroup="Gtxt" 
                    Width="250px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:TextBox ID="txtCI" runat="server" Height="22px" MaxLength="7" 
                    ValidationGroup="Gtxt" Width="100px"></asp:TextBox>
                <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nombre&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                CI</td>
            <td class="style1">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtCI" ErrorMessage="RequiredFieldValidator" 
                    Font-Size="Smaller" ForeColor="Red" ValidationGroup="Gtxt">Debe introducir un CI</asp:RequiredFieldValidator>
&nbsp;<br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtCI" ErrorMessage="RegularExpressionValidator" 
                    Font-Size="Smaller" ForeColor="Red" ValidationExpression="\d+" 
                    ValidationGroup="Gtxt">Debe introducir solo numeros</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ErrorMessage="RequiredFieldValidator" ControlToValidate="txtDireccion" 
                    Font-Size="Smaller" ForeColor="Red" ValidationGroup="Gtxt">Debe introducir una direccion</asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
                    ErrorMessage="RegularExpressionValidator" ControlToValidate="txtDireccion" 
                    Font-Size="Smaller" ForeColor="Red" ValidationExpression="^[a-zA-Z0-9ñÑ\s]*$" 
                    ValidationGroup="Gtxt">Debe introduir solo letras y numeros</asp:RegularExpressionValidator>
            </td>
            <td align="center" class="style3" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000">
                <asp:TextBox ID="txtDireccion" runat="server" Height="60px" 
                    TextMode="MultiLine" ValidationGroup="Gtxt" Width="250px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:TextBox ID="txtTelefono" runat="server" Height="22px" MaxLength="7" 
                    ValidationGroup="Gtxt" Width="100px"></asp:TextBox>
                <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                Direccion&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                Telefono</td>
            <td class="style2">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                    ControlToValidate="txtTelefono" ErrorMessage="RequiredFieldValidator" 
                    Font-Size="Smaller" ForeColor="Red" ValidationGroup="Gtxt">Debe introducir un telefono</asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ErrorMessage="RegularExpressionValidator" ControlToValidate="txtTelefono" 
                    Font-Size="Smaller" ForeColor="Red" ValidationExpression="\d+" 
                    ValidationGroup="Gtxt">Debe introducir solo numeros</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                    ErrorMessage="RequiredFieldValidator" ControlToValidate="txtFechainicio" 
                    Font-Size="Smaller" ForeColor="Red">Debe introducir una fecha</asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
                    ErrorMessage="RegularExpressionValidator" ControlToValidate="txtFechainicio" 
                    Font-Size="Smaller" ForeColor="Red" 
                    ValidationExpression="^(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/](19|20)\d\d$" 
                    ValidationGroup="Gtxt">Debe introducir solo numeros</asp:RegularExpressionValidator>
            </td>
            <td align="center" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000">
                <asp:TextBox ID="txtFechainicio" runat="server" Height="22px" 
                    ValidationGroup="Gtxt" Width="150px"></asp:TextBox>
                <obout:Calendar ID="Calendar1" runat="server" CultureName="es-ES" 
                    DatePickerMode="True" TextBoxId="txtFechainicio" 
                    DatePickerImagePath="~/Imagenes/calendario.gif">
                </obout:Calendar>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:TextBox ID="txtFechafin" runat="server" Height="22px" 
                    ValidationGroup="Gtxt" Width="150px"></asp:TextBox>
                <obout:Calendar ID="Calendar2" runat="server" CultureName="es-ES" 
                    DatePickerImagePath="~/Imagenes/calendario.gif" DatePickerMode="True" 
                    TextBoxId="txtFechafin">
                </obout:Calendar>
                <br />
                Fecha Inicio Contrato&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                Fecha Fin Contrato&nbsp;&nbsp;&nbsp; 
            </td>
            <td class="style1">
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                    ErrorMessage="RegularExpressionValidator" ControlToValidate="txtFechafin" 
                    Font-Size="Smaller" ForeColor="Red" 
                    ValidationExpression="^(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/](19|20)\d\d$" 
                    ValidationGroup="Gtxt">Debe introducir solo numeros</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                    ErrorMessage="RequiredFieldValidator" ControlToValidate="txtUsuario" 
                    Font-Size="Smaller" ForeColor="Red" ValidationGroup="Gtxt">Debe introducir un usuario</asp:RequiredFieldValidator>
                <br />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" 
                    ErrorMessage="RegularExpressionValidator" ControlToValidate="txtUsuario" 
                    Font-Size="Smaller" ForeColor="Red" ValidationExpression="^[a-zA-Z0-9ñÑ\s]*$" 
                    ValidationGroup="Gtxt">Debe introducir solo numeros y letras</asp:RegularExpressionValidator>
            </td>
            <td align="center" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000">
                <asp:TextBox ID="txtUsuario" runat="server" Height="22px" 
                    ValidationGroup="Gtxt" Width="150px"></asp:TextBox>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:TextBox ID="txtContraseña" runat="server" Height="22px" 
                    ValidationGroup="Gtxt" Width="150px" TextMode="Password"></asp:TextBox>
                <br />
&nbsp;&nbsp;&nbsp; Usuario&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                Contraseña</td>
            <td class="style1">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ErrorMessage="RequiredFieldValidator" ControlToValidate="txtContraseña" 
                    Font-Size="Smaller" ForeColor="Red" ValidationGroup="Gtxt">Debe introducir una contraseña</asp:RequiredFieldValidator>
                <br />
            </td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000">
                <asp:DropDownList ID="ddlTresponsable" runat="server" Height="22px" 
                    ValidationGroup="Gtxt" Width="250px" DataSourceID="sdsTipo" 
                    DataTextField="snombrecargo" DataValueField="Itiporesponsable_id">
                </asp:DropDownList>
                <asp:SqlDataSource ID="sdsTipo" runat="server" 
                    ConnectionString="Data Source=M38;Initial Catalog=ActivosFijos;Integrated Security=True" 
                    ProviderName="System.Data.SqlClient" 
                    SelectCommand="SELECT * FROM [prt_tiporesponsable]"></asp:SqlDataSource>
                <br />
                Tipo Responsable</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000">
                <asp:LoginView ID="LoginView2" runat="server">
                    <RoleGroups>
                        <asp:RoleGroup Roles="Administrador">
                            <ContentTemplate>
                                <asp:Button ID="btnRegistrar" runat="server" Text="Registrar" 
                                    ValidationGroup="Gtxt" onclick="btnRegistrar_Click" />
                            </ContentTemplate>
                        </asp:RoleGroup>
                    </RoleGroups>
                </asp:LoginView>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LoginView ID="LoginView1" runat="server">
                    <RoleGroups>
                        <asp:RoleGroup Roles="Administrador">
                            <ContentTemplate>
                                <asp:Button ID="btnModificar" runat="server" Text="Modificar" 
                                    ValidationGroup="Gtxt" onclick="btnModificar_Click" />
                            </ContentTemplate>
                        </asp:RoleGroup>
                    </RoleGroups>
                </asp:LoginView>
            </td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" 
                style="border-style: none solid solid solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center">
                <asp:GridView ID="grvResponsable" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" Caption="Lista Responsables" CellPadding="4" 
                    ForeColor="#333333" GridLines="None" ShowHeaderWhenEmpty="True" 
                    ViewStateMode="Enabled" onrowcommand="grvResponsable_RowCommand">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="Codigo" HeaderText="Codigo">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Nombre" HeaderText="Nombre">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="200px" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Carnetidentidad" HeaderText="CI">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Direccion" HeaderText="Direccion" Visible="False">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Telefono" HeaderText="Telefono">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Iniciocontrato" HeaderText="Fecha Inicio" Visible="False">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Fincontrato" HeaderText="Fecha Fin" Visible="False">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Codigo" HeaderText="Tipo Resp." Visible="False">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Usuario" HeaderText="Usuario" Visible="False">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Contraseña" HeaderText="Contraseña" Visible="False">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Seleccionar">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <ItemTemplate>
                                <asp:ImageButton CommandName="Seleccionar" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"codigo") %>' runat="server" ID="Edit" ImageUrl='~/Imagenes/Seleccionar.png' />
			                </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Eliminar">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <ItemTemplate>
                                    <asp:ImageButton CommandName="Eliminar" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"codigo") %>' runat="server" ID="Delete" ImageUrl='~/Imagenes/Eliminar.png' />
			                </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
            </td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

